<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //面试题1
        // const pr1 = new Promise(
        //     (resolve,reject) => {
        //         console.log('promise1')
        //     }
        // )
        // console.log('1',pr1);

        //面试题2
        // const pr2 = new Promise(
        //     (resolve,reject) => {
        //         console.log(1);
        //         resolve('success')
        //         console.log(2)
        //     }
        // )
        // pr2.then(
        //     () => {
        //         console.log(3)
        //     }
        // )
        // console.log(4);  

        //面试题3
        const pr3 = new Promise(
            (resolve,reject) => {
                console.log(1);
                console.log(2)
            }
        )
        pr3.then(
            () => {
                console.log(3)
            }
        )
        console.log(4);   
    </script>
</body>
</html>